
<h1><span class="yiyi-st" id="yiyi-12">numpy.testing.decorators.deprecated</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.testing.decorators.deprecated.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.testing.decorators.deprecated.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="function">
<dt id="numpy.testing.decorators.deprecated"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.testing.decorators.</code><code class="descname">deprecated</code><span class="sig-paren">(</span><em>conditional=True</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/testing/decorators.py#L222-L272"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">在运行测试套件时过滤弃用警告。</span></p>
<p><span class="yiyi-st" id="yiyi-15">这个装饰器可以用于过滤DeprecationWarning的，以避免在测试套件运行期间打印它们，同时检查测试是否实际引发了DeprecationWarning。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-16">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-17"><strong>conditional</strong>：bool或callable，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-18">确定是否将测试标记为已弃用的标志。</span><span class="yiyi-st" id="yiyi-19">如果条件是可调用的，它在运行时用于动态做出决定。</span><span class="yiyi-st" id="yiyi-20">默认值为True。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-21">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-22"><strong>装饰器</strong>：function</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-23"><a class="reference internal" href="#numpy.testing.decorators.deprecated" title="numpy.testing.decorators.deprecated"><code class="xref py py-obj docutils literal"><span class="pre">deprecated</span></code></a>装饰器本身。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric"><span class="yiyi-st" id="yiyi-24">笔记</span></p>
<div class="versionadded">
<p><span class="yiyi-st" id="yiyi-25"><span class="versionmodified">版本1.4.0中的新功能。</span></span></p>
</div>
</dd></dl>
